/////////////////////////////////////////////////////////////////////////
//
// Amuse Engine SDK - resource
// Copyright( c) 2013.  All Rights Reserved
//
// File:		AEAtomic_win32.inl
// Author:		Gianluca Belardelli
// Date:		29/09/2014
//
/////////////////////////////////////////////////////////////////////////
#ifndef _AEATOMIC_WIN32_INL_
#define _AEATOMIC_WIN32_INL_

#include <Windows.h>

AE_FORCEINLINE AEINT32 AEAtomic::Increment( AEINT32 &nValue )
{
	return InterlockedIncrement( (long*)&nValue );
}

AE_FORCEINLINE AEINT32 AEAtomic::Decrement( AEINT32 &nValue )
{
	return InterlockedDecrement( (long*)&nValue );
}

AE_FORCEINLINE AEINT32 AEAtomic::CompareAndSwap( AEINT32 &nVar, AEINT32 &nNewVal, AEINT32 &nOldVal )
{
	return InterlockedCompareExchange( (long*)&nVar, nNewVal, nOldVal );
}

#endif // _AEATOMIC_WIN32_INL_
